home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib9 / v_11_03 / 1103092a < prev    next >
Encoding:
Text File  |  1995-11-01  |  794 b   |  30 lines

  1.      int SomeFunc(void)   
  2.           {
  3.           char    *buf1,  *buf2,  *buf3;       
  4.           int     ccode;          
  5.           if ((buf1 = malloc(1024)) == NULL)       
  6.                { 
  7.                ccode = -1;  
  8.                goto End1;       
  9.                }
  10.           if ((buf2 = malloc(1024)) == NULL)       
  11.                {
  12.                ccode = -1;  
  13.                goto End2;       
  14.                }
  15.           if ((buf3 = malloc(1024)) == NULL)       
  16.                {
  17.                ccode = -1;  
  18.                goto End3;
  19.                }
  20.           //    More code here      
  21. End3:       
  22.           free(buf3);      
  23. End2:       
  24.           free(buf2);      
  25. End1:       
  26.           free(buf1);          
  27.           return(ccode);   
  28.           }
  29.  
  30.